export function getfrom(props) {
    let params = {};
    let formdata = props.listConfig.searchForm.forms;
    formdata.map((item) => {
        if (item.fieldType == "slot") return;
        if (item.fieldType == "daterange") {
            let d1 = item.modelValue[0];
            let d2 = item.modelValue[1];
            let data1 = "";
            let data2 = "";
            if (d1) {
                data1 = `${d1.getFullYear()}-${("0" + (d1.getMonth() + 1)).substr(
                    -2
                )}-${("0" + d1.getDate()).substr(-2)}`;
            }
            if (d2) {
                data2 = `${d2.getFullYear()}-${("0" + (d2.getMonth() + 1)).substr(
                    -2
                )}-${("0" + d2.getDate()).substr(-2)}`;
            }
            params[eval(item.prop.toString())[0]] = data1;
            params[eval(item.prop.toString())[1]] = data2;
        } else if (item.fieldType == "date") {
            let data = "";
            if (item.modelValue) {
                data = `${item.modelValue.getFullYear()}-${(
                    "0" +
                    (item.modelValue.getMonth() + 1)
                ).substr(-2)}-${("0" + item.modelValue.getDate()).substr(-2)}`;
            }
            params[item.prop] = data;
        } else {
            params[item.prop] = item.modelValue;
        }
    });
    return params;
}
